package com.xmy.cultivate.schedule;

import com.xmy.cultivate.service.IEnrollInfoService;
import com.xmy.cultivate.service.IStudentGradeService;
import com.xmy.cultivate.util.SpringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 更新招生数据，是否上课大于2次课信息
 */
public class   EnrollJob implements Job {

    @Autowired
    IEnrollInfoService iEnrollInfoService = SpringUtils.getBean(IEnrollInfoService.class);	;

    private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    private void before() {
        System.out.println("任务1：开始执行-招生数据信息更新-" + dateFormat.format(new Date()));
    }

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        iEnrollInfoService.updateIsTrue();
    }

    private void after() {
        System.out.println("任务1：执行结束补-招生数据信息更新");
    }
}
